package in.careerscale.apps.ocms.dao.model;

// Generated Jul 7, 2013 10:49:55 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CaseDiscussion generated by hbm2java
 */
@Entity
@Table(name = "case_discussion", catalog = "ocms")
public class CaseDiscussion implements java.io.Serializable {

	private Integer id;
	private LoginMaster loginMaster;
	private DocumentType documentType;
	private CaseDiscussion caseDiscussion;
	private CaseMaster caseMaster;
	private String comments;
	private Date createdOn;
	
	private String subject;

	@Column(name = "subject", length = 16777215)
	public String getSubject()
	{
		return subject;
	}
	public void setSubject(String subject)
	{
		this.subject = subject;
	}

	
	private Set caseDiscussions = new HashSet(0);

	public CaseDiscussion() {
	}

	public CaseDiscussion(LoginMaster loginMaster, DocumentType documentType,
			CaseDiscussion caseDiscussion, CaseMaster caseMaster,
			String comments, Date createdOn, Set caseDiscussions, String subject) {
		this.loginMaster = loginMaster;
		this.documentType = documentType;
		this.caseDiscussion = caseDiscussion;
		this.caseMaster = caseMaster;
		this.comments = comments;
		this.createdOn = createdOn;
		this.caseDiscussions = caseDiscussions;
		this.subject = subject;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "created_by")
	public LoginMaster getLoginMaster() {
		return this.loginMaster;
	}

	public void setLoginMaster(LoginMaster loginMaster) {
		this.loginMaster = loginMaster;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "type_id")
	public DocumentType getDocumentType() {
		return this.documentType;
	}

	public void setDocumentType(DocumentType documentType) {
		this.documentType = documentType;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "parent_discussion_id")
	public CaseDiscussion getCaseDiscussion() {
		return this.caseDiscussion;
	}

	public void setCaseDiscussion(CaseDiscussion caseDiscussion) {
		this.caseDiscussion = caseDiscussion;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "case_id")
	public CaseMaster getCaseMaster() {
		return this.caseMaster;
	}

	public void setCaseMaster(CaseMaster caseMaster) {
		this.caseMaster = caseMaster;
	}

	@Column(name = "comments", length = 16777215)
	public String getComments() {
		return this.comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_on", length = 19)
	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "caseDiscussion")
	public Set<CaseDiscussion> getCaseDiscussions()
	{
		return this.caseDiscussions;
	}

	public void setCaseDiscussions(Set<CaseDiscussion> caseDiscussions)
	{
		this.caseDiscussions = caseDiscussions;
	}

}
